package com.wxy.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

@Configuration
public class controllerConfig implements WebMvcConfigurer{
	@Autowired
	private StringRedisTemplate stringRedisTemplate;
//	@Override
//	public void configureViewResolvers(ViewResolverRegistry registry) {
//		// TODO 自动生成的方法存根
//		InternalResourceViewResolver resolver1=new InternalResourceViewResolver();
//		resolver1.setPrefix("/html/");
//		resolver1.setSuffix(".html");
//		registry.viewResolver(resolver1);
//		InternalResourceViewResolver resolver2 = new InternalResourceViewResolver();
//	    resolver2.setPrefix(""); // 不设置前缀
//	    resolver2.setSuffix(""); // 不设置后缀
//	    registry.viewResolver(resolver2);
//	}
//	@Override
//	public void addInterceptors(InterceptorRegistry registry) {
//		// TODO 自动生成的方法存根
//		registry.addInterceptor(new MyhandleInterceptor(stringRedisTemplate)).excludePathPatterns("/index.html","/html/index","/html/hello.html");
//	}
}
